function open_edit_stat(action)
{
	document.getElementById("status").style.visibility = action;
//	if (document.getElementById("status").style.visibility == "hidden")
// 	{
// 		document.getElementById("status").style.visibility = "visible";
// 	}
// 	else
// 	{
// 		document.getElementById("status").style.visibility = "hidden";
// 		stat = document.getElementById("status").value;
// 	}
}
function stat_edit(s)
{
	var input = document.getElementById("status");
	var znachenie = input.value;

		var req = getXmlHttp();
		req.open('GET', 'status_change.pl?status='+znachenie, true);
		req.onreadystatechange = function()
		{
			if (req.readyState == 4)
			{
				if(req.status == 200)
				{
					input.znachenie = req.responseText;
					stat = req.responseText;
				}
			}
		}
		req.send(null) 
	var t=setTimeout("open_edit_stat('hidden')",5000);
	
}
function user_info_edit(type)
{
	var input = document.getElementById(type);
	var znachenie = input.value;

		var req = getXmlHttp();
		req.open('GET', 'info_edit.pl?type='+ type +'&new_info='+znachenie, true);
		req.onreadystatechange = function()
		{
			if (req.readyState == 4)
			{
				if(req.status == 200)
				{
					document.getElementById(type+'_message').innerHTML = '<span class="imp">' + req.responseText + '</span>';
					input.znachenie = req.responseText;
					stat = req.responseText;
				}
			}
		}
		req.send(null) 
	var t=setTimeout("open_edit_stat('hidden')",5000);
	
}
function change_sex()
{
	document.getElementById("sex_message").innerHTML = '<span class="imp">Смена пола — сложная и дорогая операция))</span>';
}
